FROM ubuntu:18.04

MAINTAINER Quectel
LABEL version="1.0"

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get upgrade --assume-yes
RUN DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes apt-utils
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y sudo

RUN apt-get install --assume-yes 

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone

ARG user=test

RUN useradd --create-home --no-log-init --shell /bin/bash ${user} \
    && adduser ${user} sudo \
    && echo "${user}:1" | chpasswd

RUN apt-get install --assume-yes bison gcc make build-essential libc6-dev-i386 libncurses-dev wget coreutils diffstat  chrpath cpio  \
	   gawk git git-core help2man libtool libxml2-dev quilt sed subversion texi2html texinfo unzip flex libtinfo5 locales   \
 	   diffstat unzip texinfo gcc-multilib build-essential chrpath socat python  python-pip  \
	   xz-utils debianutils iputils-ping  texlive python perl  \
	   mc re2c g++ bc zip u-boot-tools  rsync  zstd  liblz4-tool  liblzo2-dev  \
 	   squashfs-tools   \
	   openssh-server
# liblzo2-dev  for R15 openLinux
#  squashfs-tools is for ql-ol-sdk

RUN update-alternatives --install /usr/bin/python  python /usr/bin/python2  2700

RUN  locale-gen en_US.UTF-8

ENV LC_ALL  en_US.UTF-8

RUN ln -sf /bin/bash /bin/sh 

EXPOSE 22
# Do not set the locale to LC
RUN sed -i '/^AcceptEnv LANG LC_\*/c\AcceptEnv no' /etc/ssh/sshd_config

# RUN /etc/init.d/ssh start

# CMD ["/usr/sbin/sshd", "-D"]

USER  ${user}
